#include"MyKV.cpp"
#include<string>
using namespace std;

int main() {

    MyKV<int, string> *a = new MyKV<int, string>();
    cout << "*******add*******" << endl;
    for(int i = 1; i <= 10; i ++) {
        a->add(i, to_string(i));
    }
    
    cout << "*******display*******" << endl;
    a->display();

    MyKV<int, string>::iterator* it = new MyKV<int, string>::iterator(a->get());
    cout << "*******begin*******" << endl;
    it->begin();
    cout << it->key() << " " << it->value() << endl;

    cout << "*******next*******" << endl;
    it->next();
    cout << it->key() << " " << it->value() <<endl;
 
    cout << "*******end*******" << endl;
    it->end();
    cout << it->key() << " " << it->value() <<endl;

    cout << "*******prev*******" << endl;
    it->prev();
    cout << it->key() << " " << it->value() <<endl;

    cout << "*******update*******" << endl;
    a->update(10, "11");
    it->end();
    cout << it->key() << " " << it->value() <<endl;
    bool flag = a->update(11, "11");
    cout << flag << endl;
    cout << it->key() << endl;

    cout << "*******dump******" << endl;
    a->dump();

    return 0;


}
